//
//  KNewsPersonalDetailController.m
//  Keping
//
//  Created by apple on 2017/11/25.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import "KNewsPersonalDetailController.h"
#import <WebKit/WebKit.h>
#import "KPersonalModel.h"
#import "ZMZWebContentView.h"

@interface KNewsPersonalDetailController ()

@property(nonatomic,weak) IBOutlet ZMZWebContentView *webBaseView;
@property(nonatomic,weak) IBOutlet UILabel *personalTitle;
@property(nonatomic,weak) IBOutlet UILabel *personalTime;

@end

@implementation KNewsPersonalDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self setUI];
}

- (void)setUI {
    self.view.backgroundColor = kWhiteColor;
    self.title = @"Personal Notice";
    if (self.recommendView) {
        [self.webBaseView setShouldStartLoadBlock:^BOOL(WKWebView *webView, NSURLRequest *request) {
            return YES;
        }];
        [self.webBaseView loadHtmlContentWithHtmlString:self.recommendView.content];
        
        self.personalTitle.text = self.recommendView.subject;
        NSTimeInterval second = self.recommendView.createTime / 1000.0;
        NSDate *date = [NSDate dateWithTimeIntervalSince1970:second];
        NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
        fmt.dateFormat = @"yyyy-MM-dd HH:mm:ss";
        NSString *dateStr = [fmt stringFromDate:date];
        self.personalTime.text  = dateStr;
    } else {
        
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
